package com.cartoon.controller;

import com.cartoon.entity.Chapter;
import com.cartoon.service.ChapterService;
import com.cartoon.util.ResponseData;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Chapter)表控制层
 *
 * @author makejava
 * @since 2021-12-10 11:28:08
 */
@RestController
@RequestMapping("chapter")
public class ChapterController {
    /**
     * 服务对象
     */
    @Resource
    private ChapterService chapterService;
    @GetMapping("getChapterByCartoonId")
    public ResponseData getChapterByCartoonId(int cartoonId){
        return chapterService.getChapterByCartoonId(cartoonId);
    }
    @GetMapping("getContentByCartoonId")
    public  ResponseData getContentByCartoonId(Integer cartoonId,Integer chapterNumber){
        System.out.println(cartoonId);
        return chapterService.getContentByCartoonId(cartoonId,chapterNumber);
    }
    @GetMapping("getContentByChapterNumber")
    public ResponseData getContentByChapterNumber(int cartoonId,int chapterNumber){
        return chapterService.getContentByChapterNumber(cartoonId,chapterNumber);
    }

}

